import time
f = open('m1_sorted.txt')
sp = list(map(int, f))
start = time.time()
for i in range(len(sp) - 1):
    for j in range(len(sp) - 1 - i):
        if sp[j] > sp[j + 1]:
            sp[j], sp[j + 1] = sp[j + 1], sp[j]
end = time.time()
print('m1_sorted', round((end - start) * 1000), 'milliseconds')
f2 = open('m2_reverse.txt')
sp2 = list(map(int, f2))
start2 = time.time()
for i in range(len(sp2) - 1):
    for i in range(len(sp2) - 1 - i):
        if sp2[j] > sp2[j + 1]:
            sp2[j], sp2[j + 1] = sp2[j + 1], sp2[j]
end2 = time.time()
print('m2_reverse', round((end2 - start2) * 1000), 'milliseconds')
f3 = open('m3_shuffle.txt')
sp3 = list(map(int, f3))
start3 = time.time()
for i in range(len(sp3) - 1):
    for i in range(len(sp3) - 1 - i):
        if sp3[j] > sp3[j + 1]:
            sp3[j], sp3[j + 1] = sp3[j + 1], sp3[j]
end3 = time.time()
print('m3_shuffle', round((end3 - start3) * 1000), 'milliseconds')
